import {
	getMyInfoAPI
} from '../../request/api/myInfo.js'

export default {
	namespaced: true,
	state: {
		// 各个级联列表
		listData: {
			college: [{
				text: '111',
				value: '111',
			}, {
				text: '222',
				value: '222',
			}],
			major: [{
				text: '111',
				value: '333',
			}, {
				text: '222',
				value: '444',
			}],
			class: [{
				text: '111',
				value: '555',
			}, {
				text: '222',
				value: '666',
			}],
			number: [{
				text: '111',
				value: '777',
			}, {
				text: '222',
				value: '888',
			}],
		},

		// 级联选项框绑定的值
		bindInfo: {
			college: '',
			major: '',
			class: '',
			number: '',
		}

	},
	mutations: {
		changeMyInfo: (state, info) => {
			state.listData = info
		}
	},
	actions: {
		getMyInfo: async (context) => {
			const res = await getMyInfoAPI()
			console.log(res)
			context.commit('changeMyInfo', res)
		}
	}
}